package getData.GetData;

public class GetDataWork implements  GetData{

   public  Worker work;

   public static void main(String[] args) {
      GetDataWork worker = new GetDataWork();

      worker.commandWork("DB", "商品");
      worker.commandWork("Cache", "商品");
      worker.commandWork("DB", "订单");
      worker.commandWork("avi", "服装");
   }

   public String commandWork (String worker,String data){

      //播放 mp3 音乐文件的内置支持
      if("DB".equals(worker)){
         System.out.println("从数据库("+worker+")中查询 "+ data+"的数据");
      }
      else if("Cache".equals(worker)){
         System.out.println("从缓存中("+worker+")查询 "+ data+"的数据");
      }
      else{
         System.out.println("您查询数据的访问源:"+worker+"不存在");
      }
      return null;
   }


}
